package com.siqi.hr.system.organization.service;

import com.siqi.hr.system.common.model.ModuleType;
import com.siqi.hr.system.organization.dao.intf.MenuDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 权限菜单维护service
 * @author  xiaogq
 * Created by xiaogoingqin on 2016/7/23.
 */
@Service("menuService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class MenuService {

    @Autowired
    private MenuDao menuDao;

    /**
     * 根据角色id、部门id、要登陆的模块查询权限菜单
     * @author            xiaogq
     * @param roleid     角色id
     * @param module     登陆的模块
     * @return
     */
    public List<Map<String, Object>> getInitMenuList(String roleid, ModuleType module) {
        List<Map<String,Object>> menuList = menuDao.getInitMenuList(roleid, module);
        return menuList;
    }

}
